// booklist.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    books:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  openBookInfo: function (event) {
    var isbn = event.currentTarget.dataset.isbn;
    console.log(isbn);
    var url = '..//bookinfo/bookinfo?isbn=' + isbn;
    console.log(url);
    wx.navigateTo({
      url: '../bookinfo/bookinfo?isbn=' + isbn,
    })
  },
  onLoad: function (options) {
    var that = this;

    console.log(options);
    console.log(options.word);
    var word=options.word

    wx.request({
      url: 'https://55300249.qcloud.la/JapariFriends/searchBook',
      data: {
        condition: 'title like \'%' + word + '%\'' +
        ' or ' + 'author like \'%' + word + '%\'' +
        ' or ' + 'summary like \'%' + word + '%\''
      },
      method: 'get',
      success: function (res) {
        console.log(res)
        that.setData({
          books:res.data
        })
      }
    })
    console.log('--')
    console.log(this.data.books);

  },

})